#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

char* my_strncpy(char* dest, const char* src, size_t num)
{
	char* ret = dest;
	while (num--)
	{
		*dest++ = *src;
		if (*src != '\0')
			src++;
	}
	return ret;
}

char* my_strncat(char* dest, const char* src, size_t num)
{
	char* ret = dest;

	while (*dest)
	{
		++dest;
	}
	while (num--)
	{
		if (*src == '\0')
			break;
		*dest++ = *src++;
	}
	*dest = '\0';
	return ret;
}
int main()
{
	char a[] = "";
	char b[20] = "abcdefg";
	my_strncat(b, b, 7);
	printf(b);
	return 0;
}